// -*- coding: utf-8 -*- 
/**
 * Project: AlgorithmsLearn
 *
 * @author: yanking
 * Create time: 2022-03-03 21:13
 * IDE: IntelliJ IDEA
 * Introduction:
 */
package com.LeetCodeT.Greedy;

public class IntegerReplacement {
    public int integerReplacement(int n) {
        // 整数替换
        return (int) Math.ceil(Math.log10(n) / Math.log10(2));
    }
}
